package com.moon.mybatisplus.xxljob;

import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author ：xxx
 * @description：TODO
 * @date ：2024/05/24 17:49
 */
@Component
@RequiredArgsConstructor
@Slf4j
public class TestExecutor {

    @XxlJob("test.sayHello")
    public void test() {
        // xxlJob传参方式
        int shardIndex = XxlJobHelper.getShardIndex();
        String jobParam = XxlJobHelper.getJobParam();
        log.info("hello world!" + shardIndex);
    }
}
